import { http } from "@/utils/http";
import { bizUrlApi } from "./utils";

export type PageResult = {
  success: boolean;
  data: {
    /** 列表数据 */
    list: Array<any>;
    /** 总数 */
    total?: number;
  };
  errMsg: "";
};

export type DataResult = {
  success: boolean;
  data?: any;
  errMsg: "";
};

export const queryEconomicResultList = () => {
  return http.request<PageResult>("post", bizUrlApi("queryEconomicResultList"));
};

export const sendEmailEconomicResult = () => {
  return http.request<DataResult>("post", bizUrlApi("sendEmailEconomicResult"));
};

export const queryZjyctjWeekList = () => {
  return http.request<PageResult>("post", bizUrlApi("queryZjyctjWeekList"));
};

export const sendMainZjyctjWeek = () => {
  return http.request<DataResult>("post", bizUrlApi("sendMainZjyctjWeek"));
};

export const queryZjyctjMonthList = () => {
  return http.request<PageResult>("post", bizUrlApi("queryZjyctjMonthList"));
};

export const sendMainZjyctjMonth = () => {
  return http.request<DataResult>("post", bizUrlApi("sendMainZjyctjMonth"));
};

export const queryMailLogList = (data?: object) => {
  return http.request<PageResult>("post", bizUrlApi("queryMailLogList"), {
    data
  });
};
